class AdReslutModel {
  late int code;
  late String message;
  late Content content;

  AdReslutModel(
      {required this.code, required this.message, required this.content});

  AdReslutModel.fromJson(Map<String, dynamic> json) {
    code = json['code'];
    message = json['message'];
    content = (json['content'] != null
        ? new Content.fromJson(json['content'])
        : null)!;
  }
}

class Content {
  late int total;
  late int page;
  late int perPage;
  late List<AdItemModel> data;

  Content(
      {required this.total,
      required this.page,
      required this.perPage,
      required this.data});

  Content.fromJson(Map<String, dynamic> json) {
    total = json['total'];
    page = json['page'];
    perPage = json['per_page'];
    if (json['data'] != null) {
      data = <AdItemModel>[];
      json['data'].forEach((v) {
        data.add(new AdItemModel.fromJson(v));
      });
    }
  }
}

class AdItemModel {
  late int id;
  late String name;
  late String code;
  late String abbreviation;
  late String area;
  late String classCode;
  late String areaLevel;
  late String longitude;
  late String latitude;
  late String coordinates;
  late String zoom;
  late String standardLayer;
  late String satelliteLayer;
  late String createTime;
  late String status;
  late int parentId;
  List<AdItemModel>? children;

  AdItemModel(
      {required this.id,
      required this.name,
      required this.code,
      required this.abbreviation,
      required this.area,
      required this.classCode,
      required this.areaLevel,
      required this.longitude,
      required this.latitude,
      required this.coordinates,
      required this.zoom,
      required this.standardLayer,
      required this.satelliteLayer,
      required this.createTime,
      required this.status,
      required this.parentId,
      required this.children});

  AdItemModel.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    name = json['name'];
    code = json['code'];
    abbreviation = json['abbreviation'];
    area = json['area'];
    classCode = json['class_code'];
    areaLevel = json['area_level'];
    longitude = json['longitude'];
    latitude = json['latitude'];
    coordinates = json['coordinates'];
    zoom = json['zoom'];
    standardLayer = json['standard_layer'];
    satelliteLayer = json['satellite_layer'];
    createTime = json['create_time'];
    status = json['status'];
    parentId = json['parent_id'];
    if (json['children'] != null) {
      children = <AdItemModel>[];
      json['children'].forEach((v) {
        children!.add(new AdItemModel.fromJson(v));
      });
    }
  }
}
